<template>
  <div class="goods-card">
    <img :src="picUrl"  @click="$emit('picClick')"/>
    <p class="title">{{title}}</p>
    <p class="flex-row">
      <span class="left">
        <span class="price">￥{{price}}</span>
        <span class="model">/{{model}}</span>
      </span>

      <van-icon name="cart-o" @click="$emit('cartClick')" color="red" size="18px"></van-icon>
    </p>
  </div>
</template>

<script>
import { Icon } from 'vant';
export default {
  components: {
    [Icon.name]: Icon
  },
  name: 'circle-card',
  props: {
    picUrl: {
      type: String,
      default: ''
    },
    width: {
      type: Number,
      default: 20
    },
    title: {
      type: String,
      default: ''
    },
    price: {
      type: [Number, String]
    },
    model: {
      type: String
    }
  },
  data() {
    return {};
  },
  watch: {},
  computed: {
    imgStyle() {
      return {
        width: '100%',
        height: 'auto'
      };
    }
  },
  created() {},
  mounted() {},
  methods: {}
};
</script>
<style lang="scss" scoped>
.title {
  font-size: 12px;
  margin: 0;
}
.goods-card {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  img {
    width: 100%;
  }
}
.flex-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.price {
  color: red;
}
</style>